import requests, json
from common.consts import FANS_LIST_API_URL, API_HEADER

def get_fans_id_list_api(uid, page):
    url = FANS_LIST_API_URL + f'?relate=fans&page={page}&uid={uid}&type=fans&newFollowerCount=0'
    print(url)
    response = requests.get(url, headers=API_HEADER)
    data = json.loads(response.text)
    fans_id_list = []
    if data['ok'] == 1:
        user_list = data['users']
        for item in user_list:
            fans_id_list.append(item['id'])
    print(fans_id_list)
    return fans_id_list
